﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="StudentMoralFile.aspx.cs" Inherits="Credit_Teacher_Reprots_StudentMoralFile" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>学生德育学分记录表</title>
    <link href="../../Common/css/main.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="../../Common/js/jquery.js"></script>

    <script type="text/javascript" src="../../Common/js/common.js"></script>
    <script type="text/javascript">
        function bodyload(){
            
             show();
        }
        function show(){
            var stype =parseInt(Math.random()*100) %3;
            switch(stype)
            {
                case 0:
                document.getElementById('info').innerText = "你真棒！";
                break;
                case 1:
                document.getElementById('info').innerText = "继续努力哦！";
                break;
                case 2:
                document.getElementById('info').innerText = "加油啊！";
                break;
            }
            
           
            ShowPopForm('Congratulate', 'CongratulateTitle', '');
            setTimeout( "closeCongratulate()",5000); 
        }
        function closeCongratulate(){
            clearInterval("closeCongratulate()");
            ClosePopForm('Congratulate');
        }
    </script>
</head>
<body scroll="no"  onload="bodyload()">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    </asp:ScriptManager>
    <div class="pageBody">
        <div class="mainWarp" style="height: 96%; padding-top: 5px; padding-left: 5px; ">
            <table>
                <tr>
                    <td style="padding-left: 10px;">
                        <input type="button" class="commonBut" id="btnExport" value="导出Excel" onclick="getExcel()"
                            style="display: none;" />
                    </td>
                </tr>
            </table>
            <div style="overflow-y: auto; overflow-x: none; height: 98%;">

                <asp:UpdatePanel ID="upResult" runat="server">
                    <ContentTemplate>
                        <asp:Repeater ID="Repeater1" runat="server">
                            <HeaderTemplate>
                                <%=WriteContext() %>
                            </HeaderTemplate>
                            <ItemTemplate></ItemTemplate>
                            <FooterTemplate></FooterTemplate>
                        </asp:Repeater>
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnBind" EventName="Click" />
                    </Triggers>
                </asp:UpdatePanel>
                <div style="display: none;">
                    <asp:Button ID="btnBind" runat="server" Text="btnBind" OnClick="btnBind_Click" />
                </div>
            </div>
             <!-- 鼓励信息 -->
                <div id="Congratulate" class="layoutWarp" style="display: none; width: 340px; height: 168px;">
                    <div class="title">
                        <span id="CongratulateTitle"></span><a title="关闭" onclick="ClosePopForm('Congratulate');">
                            关闭</a>
                    </div>
                    <table border="0" class="layoutTable" style="width:300px; height: 120px;">
                        <tr>
                            <td id="info">
                                你真棒
                            </td>
                       
                        </tr>
                    </table>
                </div>
                <!-- END -->
        </div>
    </div>
    </form>
</body>
<script type="text/javascript" src="../../Common/js/TableForExport.js"></script>
<script type="text/javascript">
    function getExcel() {
        var cells = GetTableInfo(document.getElementById("tbResult"));
        if (cells != null) {
            var causeID = request("CauseID");
            if (causeID == "") causeID = -1;
            else causeID = parseInt(causeID);

            PageMethods.GetExcel(cells, causeID, function (result) {
                document.getElementById('downloadf').src = "";
                document.getElementById('downloadf').src = "../../../PostFileBytes.aspx";
            }, function (err) { alert(err._message); });
        }

    }
</script>
</html>
